/**
 * 
 */
package com.ib.dataaccess;

import java.util.logging.Level;
import java.util.logging.Logger;

import com.ib.config.ConfigurationConstants;
import com.ib.enumertion.ReaderType;

/**
 * Factory class to get the type of reader implementation. Various reader supported would be:
 * <ul>
 * <li>CSV</li>
 * <li>EXCEL</li>
 * <li>XML</li>
 * <li>PIPE_DELIMITER</li>
 * </ul>
 */
public class TransactionReaderFactory {

	private static final Logger LOGGER = Logger.getLogger(TransactionReaderFactory.class.getName());

	public static ITransactionReader getTransactionReader() {

		ITransactionReader transactionReader = null;

		ReaderType configuredReaderType = ConfigurationConstants.CONFIGURED_READER_TYPE;
		switch (configuredReaderType) {
			case CSV:
				transactionReader = new CSVTransactionReader();
				break;
			default:
				LOGGER.log(Level.SEVERE, "No Transaction Reader configured for :" + configuredReaderType);
				break;
		}
		return transactionReader;
	}
}